package com.example.admin.yuejian21.Model;

import com.example.admin.yuejian21.Bean.Login;
import com.example.admin.yuejian21.Bean.OrderInfo;
import com.example.admin.yuejian21.Bean.Reg;
import com.example.admin.yuejian21.Bean.UserOrder;
import com.example.admin.yuejian21.Service.Service;

<<<<<<< HEAD
import com.squareup.okhttp.Response;
import com.squareup.okhttp.ResponseBody;

import okhttp3.MultipartBody;
import retrofit2.Call;
=======
import java.util.List;

>>>>>>> 2e6d2ff2e3331c5e86ecd66212336d2d1a6d7e80
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/10/9 0009.
 */

public class UserModel {
    private Retrofit retrofit;
    public UserModel(){
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .build();
    }
    public retrofit2.Call<Login> login(String tel, String password){
        Service Service = retrofit.create(Service.class);
        return Service.getLogin(tel,password);
    }

    public retrofit2.Call<Reg> reg(String password,String tel){
         Service Service = retrofit.create(Service.class);
         return Service.reg(password,tel);
    }
    public Call signPic(String userid, String title, MultipartBody.Part file){
      Service actImpls = retrofit.create(Service.class);
        return  actImpls.signpic(userid,title,file);
    }


    public retrofit2.Call<OrderInfo> getOrderInfo(String id, String type) {
        Service Service = retrofit.create(Service.class);
        return Service.getOrder(id, type, "lgj98rfkiqvenhrk2o7oe2po81");
    }
    public retrofit2.Call<List<UserOrder>> getallorder(int userid) {
        Service userService = retrofit.create(Service.class);
        return userService.getallorder("sign", userid, "pf2cmg5jk9p24f2mv1kjf55bo3");
    }

    public retrofit2.Call<List<UserOrder>> getfinorder(int vstate, int userid) {
        Service userService = retrofit.create(Service.class);
        return userService.getordertype("sign", userid, vstate, "pf2cmg5jk9p24f2mv1kjf55bo3");
    }


}

